package com.azt.api.dto;

import com.azt.utils.PatternUtils;
import org.apache.commons.lang.StringUtils;

import javax.persistence.Transient;
import java.util.Date;

/**
 * Created by Snowler on 2016/9/26.
 */
public class QuoteEnquiryDto {

    /*询价id*/
    private Integer id;

    /*项目id*/
    private Integer projectId;

    /*类别*/
    private Integer qtype;

    /*询价名称*/
    private String enquiryName;

    /*发布公司名称*/
    private String companyName;

    /*发布公司总公司*/
    private String parentCompany;

    /*有可能存在的最高级别总公司*/
    private String ppCompany;

    /*项目名称*/
    private String projectName;

    /*质保要求*/
    private Integer quality;

    /*特殊质保要求*/
    private String guaranteeinfo;

    /*截止日期*/
    private Date deadline;

    /*是否含税*/
    private Integer taxPrice;

    private Integer taxInstro;

    /*是否含运费*/
    private Integer shipPrice;

    /*支付方式*/
    private Integer payment;

    /*分期支付的批次信息*/
    private String batchPay;

    /*支付方式转换*/
    @Transient
    private String paymentStr = "";

    /*需要供应商提供的文件*/
    private String providefiles;

    /*需要供应商提供文件替换内容*/
    @Transient
    private String replaceProvideFiles = "";

    /*联系人*/
    private String contacts;

    /*联系电话*/
    private String phone;

    /*电话的隐藏*/
    private String hidePhone;

    /*其他要求*/
    private String otherRemarks;

    /*状态*/
    private Integer state;

    /*是否有清单*/
    private Integer needdesign;

    /*项目所在省份*/
    private String provinceName;

    /*项目所在城市*/
    private String cityName;

    /*项目资料*/
    private String attachfile;
    /**
     * 资料名称
     * Created by 张栋 on 2017/4/13 13:24
     */
    private String attachfileName;

    /*清单地址*/
    private String excelpath;

    /*清单名称*/
    private String excelName;

    private String downListCus;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getQtype() {
        return qtype;
    }

    public void setQtype(Integer qtype) {
        this.qtype = qtype;
    }

    public String getEnquiryName() {
        return enquiryName;
    }

    public void setEnquiryName(String enquiryName) {
        this.enquiryName = enquiryName;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public Integer getQuality() {
        return quality;
    }

    public void setQuality(Integer quality) {
        this.quality = quality;
    }

    public String getGuaranteeinfo() {
        return guaranteeinfo;
    }

    public void setGuaranteeinfo(String guaranteeinfo) {
        this.guaranteeinfo = guaranteeinfo;
    }

    public Date getDeadline() {
        return deadline;
    }

    public void setDeadline(Date deadline) {
        this.deadline = deadline;
    }

    public Integer getTaxPrice() {
        return taxPrice;
    }

    public void setTaxPrice(Integer taxPrice) {
        this.taxPrice = taxPrice;
    }

    public Integer getShipPrice() {
        return shipPrice;
    }

    public void setShipPrice(Integer shipPrice) {
        this.shipPrice = shipPrice;
    }

    public Integer getPayment() {
        return payment;
    }

    public void setPayment(Integer payment) {
        this.payment = payment;
    }

    public String getPaymentStr() {
        if(payment != null){
            switch (payment) {
                case 1 : paymentStr = "款到发货";break;
                case 2 : paymentStr = "货到付款";break;
                case 3 : paymentStr = "分批付款";break;
            }
        }

        return paymentStr;
    }

    public void setPaymentStr(String paymentStr) {
        this.paymentStr = paymentStr;
    }

    public String getProvidefiles() {
        return providefiles;
    }

    public void setProvidefiles(String providefiles) {
        this.providefiles = providefiles;
    }

    public String getReplaceProvideFiles() {

        if(StringUtils.isNotBlank(providefiles)){
            replaceProvideFiles = providefiles.replace("1" , "解决方案").replace("2" , "拓扑图");
        }


        return replaceProvideFiles;
    }

    public void setReplaceProvideFiles(String replaceProvideFiles) {
        this.replaceProvideFiles = replaceProvideFiles;
    }

    public String getContacts() {
        return contacts;
    }

    public void setContacts(String contacts) {
        this.contacts = contacts;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getOtherRemarks() {
        return otherRemarks;
    }

    public void setOtherRemarks(String otherRemarks) {
        this.otherRemarks = otherRemarks;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getNeeddesign() {
        return needdesign;
    }

    public void setNeeddesign(Integer needdesign) {
        this.needdesign = needdesign;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getAttachfile() {
        return attachfile;
    }

    public void setAttachfile(String attachfile) {
        this.attachfile = attachfile;
    }

    public String getExcelpath() {
        return excelpath;
    }

    public void setExcelpath(String excelpath) {
        this.excelpath = excelpath;
    }

    public String getExcelName() {
        return excelName;
    }

    public void setExcelName(String excelName) {
        this.excelName = excelName;
    }

    public Integer getProjectId() {
        return projectId;
    }

    public void setProjectId(Integer projectId) {
        this.projectId = projectId;
    }

    public Integer getTaxInstro() {
        return taxInstro;
    }

    public void setTaxInstro(Integer taxInstro) {
        this.taxInstro = taxInstro;
    }

    public String getHidePhone() {
        if(StringUtils.isNotBlank(phone) && PatternUtils.isMobile(phone)){
            hidePhone = phone.substring(0 , 3) + "****" + phone.substring(phone.length() - 4);
        }
        return hidePhone;
    }

    public void setHidePhone(String hidePhone) {
        this.hidePhone = hidePhone;
    }

    public String getParentCompany() {
        return parentCompany;
    }

    public void setParentCompany(String parentCompany) {
        this.parentCompany = parentCompany;
    }

    public String getPpCompany() {
        return ppCompany;
    }

    public void setPpCompany(String ppCompany) {
        this.ppCompany = ppCompany;
    }

    public String getDownListCus() {
        return downListCus;
    }

    public void setDownListCus(String downListCus) {
        this.downListCus = downListCus;
    }

    public String getBatchPay() {
        return batchPay;
    }

    public void setBatchPay(String batchPay) {
        this.batchPay = batchPay;
    }

    public String getAttachfileName() {
        return attachfileName;
    }

    public void setAttachfileName(String attachfileName) {
        this.attachfileName = attachfileName;
    }
}
